home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97a.txt
/
000055_icon-group-sender _Fri Feb 28 14:17:52 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Received: by cheltenham.cs.arizona.edu; Fri, 28 Feb 1997 16:24:05 MST
Message-Id: <1.5.4.32.19970228201752.006dcf90@post.its.mcw.edu>
X-Sender: cdt@post.its.mcw.edu
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Fri, 28 Feb 1997 14:17:52 -0600
To: "John H. Lindsay" <lindsay_j@rmc.ca>, icon-group@cs.arizona.edu
From: Chris Tenaglia <cdt@post.its.mcw.edu>
Subject: Re: Icon and two-dimensional matching
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 2375
snip...snip...
>
>The worst part is that, currently, Icon lacks anything like SNOBOL4's
>OPSYN that can be used to give unused unary prefix or binary infix
>operators a meaning or a new meaning. Fortunately, with
>SNOBOL's polymorphic data, the ability to overload operators
>is implicit and it would be implicit in Icon too if Icon had an
>OPSYN-like facility.
Since icon variables are not typed, the operators are. So if you were
to define a operator, it seems like you'd need some way to define
a new "data" type that the operator would cast the variable into.
.snip..
>For this type of end, I'd love to see the ability in Icon to create new
>operators, and to extend and to redefine existing operators. Even
>though Icon has very many pre-defined operators, Individual
>problems need more operators, and it seems to me that the lexical
>rule for 'what's an operator' is simple. I'd hope that the facility would
>generalize the idea of prefix vs postfix for unary operators with the
>idea of 2-operator and n-operator binary and n-ary expressions;
>such things seem to occur easily in natural language expressions.
>The scope of such extensions could be open to discussion, but
>with record type definitons being global to a program, global scope
>might be appropriate. I wouldn't mind having to code parentheses
>to resolve ambiguities for this sort of thing.
I suggested this once too. I envisioned using the $ as a dynamic
programmer defined operator. You'd need to define unary and
binary properties and have to be careful about data conversions.
But I guess someone was assigning $ to be some other part of
the language at the time, and the idea never caught on.
examples....
_____________________________________________________
operator unary(myfunc)
operator binary(otherfunc)
procedure myfunc(a)
return a * sin(1.00/a)
end
procedure otherfunc(a,b)
return a*a + b*b
end
______________________________________________________
>John H. Lindsay,
>DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE
>ROYAL MILITARY COLLEGE OF CANADA
>PO BOX 17000 STN FORCES
>KINGSTON ON K7K7B4
>
>
Chris Tenaglia (system manager) | cdt@post.its.mcw.edu
Medical College of Wisconsin |
8701 W. Watertown Plank Rd. | Ce que vous voyez est
Milwaukee, WI 53226 (414)456-8765 | Ce que vous obtenez !